'''
Created on Sep 19, 2010

@author: oabalbin
'''
import numpy as np
from collections import deque
from Bio.Seq import Seq
from Bio import SeqIO
from Bio.SeqRecord import SeqRecord


def process_file(fastafile, outfasta):
    outfile = open(outfasta,'w')
    flag=False
    for line in fastafile:
        if line.startswith('>') and not flag:
            outfile.write(line)
            flag=True
            continue
        
        if flag:
            #read_extractor_write(list(line.strip('\n')),outfile)
            print line
            flag=False

    outfile.close()

inputfile_name = '/exds/users/oabalbin/projects/mirnas/test/test1/all_reads_chopped.fa'
mykey = 'PATHBIO-SOLEXA2_0003:3:91:16061:2005#0'
record_dict = SeqIO.index(inputfile_name, "fasta")

print record_dict['PATHBIO-SOLEXA2_0003:3:91:16061:2005#0']